package com.vv.api_manage.controller;

import com.vv.api_manage.entity.ApiInterface;
import com.vv.api_manage.mapper.ApiInterfaceItemMapper;
import com.vv.api_manage.mapper.ApiInterfaceMapper;
import com.vv.api_manage.service.IApiInterface;
import com.vv.api_manage.utils.ResultUtil;
import com.vv.api_manage.utils.UUID32;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description
 * @Author xingchao
 * @Date 2021/1/22 10:31
 */
@Controller
@RequestMapping("/api/show")
public class ShowApiCtrl {

    @Autowired
    private IApiInterface interfaceService;

    @Autowired
    private  ApiInterfaceMapper interfaceMapper;
    @RequestMapping("abc")
    public String toList(){
        return "/pages/apiList";
    }

    @RequestMapping("table")
    public String toList2(){
        return "/pages/table";
    }

    @RequestMapping("getList")
    @ResponseBody
    public ResultUtil test(){
        ResultUtil<Object> result = new ResultUtil<>();
        List<ApiInterface> apiList=this.interfaceMapper.selectAll();
        result.setCode(0);
        result.setCount(558);
        result.setMsg("成功");
        result.setData(apiList);
        return result;
    }
}
